package org.example;

import dev.langchain4j.model.openai.OpenAiChatModel;

/**
 * Hello world!
 */
public class App {
	public static void main(String[] args) {
		//2.构建 OpenAiChatModel 对象
		OpenAiChatModel model = OpenAiChatModel.builder()
			.baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
			.apiKey("sk-9237ff7f33614fd6891a7a91b347e194")
			.modelName("qwen-plus")
			.logRequests(true)
			.logResponses(true)
			.build();
		//3.调用 chat 方法交互
		String result = model.chat("石嘉宝是谁？");
		System.out.println(result);
	}
}
